-
-
Notifications
You must be signed in to change notification settings - Fork 689
Implement isdisjoint for finite sets
#41107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
pyrightconfig.json
Outdated
| "reportOptionalOperand": "warning", | ||
| "reportMissingImports": "warning", | ||
| "reportMissingModuleSource": "warning", | ||
| "strictParameterNoneValue": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many methods in cachefunc.pyi and otherwise as well use f=None and similar definitions.
|
Documentation preview for this PR (built with commit f9f140f; changes) is ready! 🎉 |
|
I don't quite understand: are the changes below |
| return rich_to_bool(op, 0) | ||
| return rich_to_bool(op, -1) | ||
|
|
||
| def isdisjoint(self, other): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The standard in Sage is to add underscores between separate words in method names.
| def isdisjoint(self, other): | |
| def is_disjoint(self, other): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest not to do this in this very special case, because Set is supposed to be a "better" set (it is not, in my opinion, but it tries), and it is set.isdisjoint rather than set.is_disjoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I have to take this back, the situation in sage is already chaotic :-(
Set (and FrozenBitset) indeed implements issubset etc., but there are some classes (MutablePoset, ManifoldSubset, RealSet, I couldn't find any others) that implement is_subset. In #41113, another class is going to implement is_subset.
It is not clear to me what's best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose fundamentally we should make a choice and then rename/deprecate. For the time being, implementing both could be alright (it's just an extra line isdisjoint = is_disjoint in the class).
Fixes #41045.
📝 Checklist
⌛ Dependencies